@extends('backend.layouts.app')

@section('content')

<div class="aiz-titlebar text-left mt-2 mb-3">
    <h5 class="mb-0 h6">{{translate('Level Information')}}</h5>
</div>

<div class="col-lg-8 mx-auto">
    <div class="card">
        <div class="card-body p-0">
{{--            <ul class="nav nav-tabs nav-fill border-light">--}}
{{--  				@foreach (\App\Models\Language::all() as $key => $language)--}}
{{--  					<li class="nav-item">--}}
{{--  						<a class="nav-link text-reset @if ($language->code == $lang) active @else bg-soft-dark border-light border-left-0 @endif py-3" href="{{ route('customers_level.edit', ['id'=>$level->id, 'lang'=> $language->code] ) }}">--}}
{{--  							<img src="{{ static_asset('assets/img/flags/'.$language->code.'.png') }}" height="11" class="mr-1">--}}
{{--  							<span>{{ $language->name }}</span>--}}
{{--  						</a>--}}
{{--  					</li>--}}
{{--	            @endforeach--}}
{{--  			</ul>--}}

            <form class="p-4" action="{{ route('customers.update', $user->id) }}" method="POST" enctype="multipart/form-data">
                <input name="_method" type="hidden" value="PATCH">
                <input type="hidden" name="lang" value="{{ $lang }}">
                @csrf
                <div class="form-group row">
                    <label class="col-sm-3 col-from-label" for="name">{{translate('Name')}}</label>
                    <div class="col-sm-9">
                        <input type="text" placeholder="{{translate('Name')}}" id="name" name="name" value="{{ $user->name }}" class="form-control">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-from-label" for="email">{{translate('Email Address')}}</label>
                    <div class="col-sm-9">
                        <input type="text" placeholder="{{translate('Email Address')}}" id="email" name="email" value="{{ $user->email }}" class="form-control">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-from-label" for="phone">{{translate('Phone')}}</label>
                    <div class="col-sm-9">
                        <input type="text" placeholder="{{translate('Phone')}}" id="phone" name="phone" value="{{ $user->phone }}" class="form-control">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-from-label" for="Level">{{translate('Level')}}</label>
                    <div class="col-md-9">
                        @foreach ($levelList as $key => $level)
                            <label class="mb-0 mr-2">
                                <input type="radio" @if($user->level == $level->id) checked @endif name="level" value="{{$level->id}}">
                                <span>{{$level->name}}</span>
                            </label>
                        @endforeach
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-from-label" for="cybt_num">{{translate('Gift Pack Number')}}</label>
                    <div class="col-sm-9">
                        <input type="text" placeholder="{{translate('Gift Pack Number')}}" id="cybt_num" name="cybt_num" value="{{ $user->cybt_num }}" class="form-control">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-from-label" for="Level">{{translate('bonus_pool')}}</label>
                    <div class="col-md-9">
                        @foreach ($bonusPoolList as $key => $pool)
                            <label class="mb-0 mr-2">
                                <input type="checkbox" @if(in_array($pool->id,$user->bonus_pool)) checked @endif name="bonus_pool[]" value="{{$pool->id}}">
                                <span>{{$pool->name}}</span>
                            </label>
                        @endforeach
                    </div>
                </div>
                <div class="form-group mb-0 text-right">
                    <button type="submit" class="btn btn-primary">{{translate('Save')}}</button>
                </div>
            </form>
        </div>
    </div>
</div>

@endsection
